﻿using System.Collections;
using System.Collections.Generic;

using UnityEngine;

public class MaxAdsManager
{
	private static MaxAdsManager _instance = null;

	public static MaxAdsManager SharedInstance()
	{
		if (_instance == null)
		{
			_instance = new MaxAdsManager();
		}

		return _instance;
	}

	private static string _sdkKey;

	public void Init(string sdkKey)
	{
		_sdkKey = sdkKey;
#if UNITY_IOS || UNITY_ANDROID || UNITY_IPHONE 
		MaxSdkCallbacks.OnSdkInitializedEvent += (MaxSdkBase.SdkConfiguration sdkConfiguration) => {
            // Show Mediation Debugger
            
	            ShowMediationDebugger();
            
		};
		MaxSdk.SetSdkKey(sdkKey);
		MaxSdk.InitializeSdk();
#endif
	}

	public bool IsInit()
	{
#if UNITY_IOS || UNITY_ANDROID || UNITY_IPHONE 
		return MaxSdk.IsInitialized();
#else
		return false;
#endif
	}

	public void ShowMediationDebugger()
	{
#if UNITY_IOS || UNITY_ANDROID || UNITY_IPHONE 
		MaxSdk.ShowMediationDebugger();
#endif
		
	}

	public string GetSdkKey()
	{
		return _sdkKey;
	}


	public void SetIsAgeRestrictedUser(bool isOn)
	{
#if UNITY_IOS || UNITY_ANDROID || UNITY_IPHONE 
		MaxSdk.SetIsAgeRestrictedUser(isOn);
#endif
	}


	public void SetHasUserConsent(bool isOn)
	{
		
#if UNITY_IOS || UNITY_ANDROID || UNITY_IPHONE 
		MaxSdk.SetHasUserConsent(isOn);
#endif
	}
}
